﻿using M_Quality.API.Application.Command.ReinspectionCommand;
using M_Quality.Repository.Interface;
using MediatR;

namespace M_Quality.API.Application.CommandHandler.ReinspectionCommandHandler
{
    /// <summary>
    /// 添加复检信息
    /// </summary>
    public class CreateReinspectionCommandHandler : IRequestHandler<CreateReinspectionCommand, int>
    {
        private readonly IReinspectionRepository _Reinspectionrepository;
        public CreateReinspectionCommandHandler(IReinspectionRepository reinspectionrepository)
        {
            _Reinspectionrepository = reinspectionrepository;
        }
        public async Task<int> Handle(CreateReinspectionCommand request, CancellationToken cancellationToken)
        {
            return await _Reinspectionrepository.AddAsync(request);
        }
    }
}
